package zhtt.demo01;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import zhtt.UserService;

import java.util.List;
import java.util.Map;

/**
 * Created by zhtt on 2017/4/19.
 */
public class Demo01Action extends ActionSupport {

    private List<String> list;

    private  Map<String,String> map;

    private List<Map<String,String>> mapList;

    private List<List<Map<String,String>>> mapListList;

    private Map<String,List<Map<String,String>>> mapListMap;

    @Action(value="map-list")
    public String mapList(){
        list=UserService.getList();
        map=UserService.getMap();
        mapList= UserService.getMapList();
        mapListList=UserService.getMapListList();
        mapListMap=UserService.getMapListMap();
        ActionContext.getContext().getSession().put("loginUser", UserService.getMap());
        return SUCCESS;
    }

    public List<Map<String,String>> getMapList(){
        return mapList;
    }

    public List<String> getList() {
        return list;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public List<List<Map<String, String>>> getMapListList() {
        return mapListList;
    }

    public Map<String, List<Map<String, String>>> getMapListMap() {
        return mapListMap;
    }
}
